<template>
    <div id="map" style="height:100%;width: 100%;"></div>
  </template>
  
  <script>
  import L from 'leaflet'
  export default {
    mounted() {
      const map = L.map('map').setView([39.90, 116.40], 13);
      const tiandituLayer = L.tileLayer('https://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=f7f564e36a80b6085e51ab919f676e73', {
        subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
        maxZoom: 18,
        minZoom: 1,
        attribution: '天地图'
      });
      tiandituLayer.addTo(map);
    }
  }
  </script>